package com.xuelang.pipeline.client.application;

import com.xuelang.pipeline.client.application.dto.TraitDTO;
import com.xuelang.pipeline.client.application.dto.TraitQuery;
import com.xuelang.pipeline.client.common.request.PageParam;
import com.xuelang.pipeline.client.common.result.ApiResult;
import com.xuelang.pipeline.client.common.result.PageRecord;
import org.springframework.web.bind.annotation.*;

import jakarta.validation.Valid;
import java.util.List;

/**
 * 运维特征服务API
 *
 * @author xiwen.zxg
 * @since 2024/5/15
 */
public interface ITraitService {

    /**
     * 查询运维特征列表(有过滤条件，可以分页)
     *
     * @param dtoPageParam
     * @return
     */
    @PostMapping(value = "/pageList", produces = "application/json;charset=utf-8")
    ApiResult<PageRecord<TraitDTO>> pageTraitList(@RequestBody @Valid PageParam<TraitQuery> dtoPageParam);

    /**
     * 查询运维特征列表(有过滤条件)
     *
     * @param traintQuery
     * @return
     */
    @PostMapping(value = "/list", produces = "application/json;charset=utf-8")
    ApiResult<List<TraitDTO>> conditionalTraitList(@RequestBody @Valid TraitQuery traintQuery);

    /**
     * 新增运维特征
     *
     * @param traintDTO
     * @return
     */
    @PostMapping(value = "", produces = "application/json;charset=utf-8")
    ApiResult<Boolean> addTrait(@RequestBody @Valid TraitDTO traintDTO);
    /**
     * 更新运维特征
     *
     * @param traintDTO
     * @return
     */
    @PutMapping(value = "", produces = "application/json;charset=utf-8")
    ApiResult<Boolean> updateTrait(@RequestBody @Valid TraitDTO traintDTO);

    /**
     * 删除运维特征
     *
     * @param traintUuid
     * @return
     */
    @DeleteMapping(value = "/{uuid}", produces = "application/json;charset=utf-8")
    ApiResult<Boolean> deleteTrait(@PathVariable("uuid") String traintUuid);
    /**
     * 查询运维特征
     *
     * @param traintUuid
     * @return
     */
    @GetMapping(value = "/{uuid}", produces = "application/json;charset=utf-8")
    ApiResult<TraitDTO> queryTrait(@PathVariable("uuid") String traintUuid);
}
